package com.google.code.sharecontent.dao;

import java.sql.SQLException;
import java.util.List;

import com.google.code.sharecontent.action.ResultContainer;
import com.google.code.sharecontent.exception.ChangeStatusException;
import com.google.code.sharecontent.model.Content;
import com.google.code.sharecontent.model.Paging;
import com.google.code.sharecontent.model.Status;

public interface ContentDao extends BaseDao<Content>{

	Content findByUrl(String url) throws SQLException;
	List<Content> findByPhrase(String name)throws SQLException;
	List<Content> findByPhraseAndStatus(String name, Integer statusId, String notIncludedIds)throws SQLException;
	List<Content> listByStatus(Integer statusId)throws SQLException;
	ResultContainer<Content> listByResourceAndStatus(Paging paging,Integer resourceId, Integer statusId)throws SQLException;
	ResultContainer<Content> listByResourceAndStatusAndPhrase(Paging paging,Integer resourceId, Integer statusId, String name)throws SQLException;
	
	boolean changeStatus(Content content, Status newStatus) throws ChangeStatusException, SQLException;
	boolean changeStatus(Integer contentId, Status newStatus) throws ChangeStatusException, SQLException;
	
}
